<div id="text-filter" class="tool-content active">
    <div class="tool-header">
        <h2>文本筛选</h2>
        <p class="tool-description">多行文本去重与筛选工具，支持高效处理大量数据</p>
    </div>

    <div class="filter-layout">
        <!-- 左侧原始文本区域 -->
        <div class="filter-column">
            <label>
                原始文本（每行一个）：
                <span class="line-counter">原始: <span id="original-count">0</span> 行</span>
            </label>
            <textarea id="original-text" class="filter-textarea" placeholder="请输入要处理的文本，每行一个..."></textarea>
        </div>

        <!-- 右侧筛选文本区域 -->
        <div class="filter-column">
            <label>
                筛选内容（每行一个）：
                <span class="line-counter">筛选: <span id="filter-count">0</span> 行</span>
            </label>
            <textarea id="filter-text" class="filter-textarea" placeholder="输入要筛选掉的内容，每行一个..."></textarea>
        </div>
    </div>

    <div class="filter-options">
        <label>处理选项：</label>
        <div class="checkbox-group">
            <label><input type="checkbox" id="remove-duplicates" checked> 去重</label>
            <label><input type="checkbox" id="case-sensitive"> 区分大小写</label>
            <label><input type="checkbox" id="trim-spaces" checked> 去除首尾空格</label>
            <label><input type="checkbox" id="remove-empty"> 去除空行</label>
            <label><input type="checkbox" id="phone-mode"> 按手机号码处理</label>
        </div>
    </div>

    <div class="filter-actions">
        <button onclick="processLines()" class="primary-btn">开始筛选</button>
        <button onclick="clearOriginal()" class="secondary-btn">清空原始</button>
        <button onclick="clearFilter()" class="secondary-btn">清空筛选</button>
        <button onclick="swapContent()" class="swap-btn">交换内容</button>
        <button onclick="clearAll()" class="secondary-btn">全部清空</button>
    </div>

    <div class="filter-result">
        <label>
            处理结果：
            <span class="result-stats">
                结果: <span id="result-count">0</span> 行 | 
                减少: <span id="reduced-count">0</span> 行
            </span>
        </label>
        <textarea id="processed-result" class="result-textarea" readonly></textarea>
        <div style="margin-top: 10px;">
            <button onclick="copyToClipboard('processed-result')" class="copy-btn" style="background: #007bff; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer;">复制结果</button>
        </div>
    </div>
</div>